<%@ page contentType="image/png" import="java.util.*,java.awt.*,java.io.*,java.awt.image.*,javax.imageio.*" pageEncoding="utf-8"%>
<%!
    Color getRandColor(int fc, int bc) {
        Random random = new Random();
        if(fc > 255) fc = 255;
        if(bc > 255) bc = 255;
        int r = fc + random.nextInt(bc - fc);
        int g = fc + random.nextInt(bc - fc);
        int b = fc + random.nextInt(bc - fc);
        return new Color(r, g, b);
    }
%>
<%
    response.setHeader("Pragma", "No-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
 
    int width = 130, height = 200;
    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics g = image.getGraphics();
    for (int i = 0; i < 10; i++) {
        g.setColor(getRandColor(200, 250));
        g.fillRect(0, i * 20, width, (i+1) * 20);
    }
    g.setFont(new Font("Times New Roman", Font.PLAIN, 18));
    Random random = new Random();
 
    g.setColor(getRandColor(160, 200));
    for (int i = 0; i < 15000; i++) {
        int x = random.nextInt(width);
        int y = random.nextInt(height);
        g.drawLine(x, y, x, y);
    }
 
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++){
            g.setColor(getRandColor(20, 130));
            g.drawString(String.valueOf(j), j*13 + 3, i*20 + 16);
        }
    }
 
    g.setColor(getRandColor(200, 250));
    for (int i = 0; i < 2000; i++) {
        int x = random.nextInt(width - 12);
        int y = random.nextInt(height);
        g.drawLine(x, y, x, y);
    }
 
    g.dispose();
    OutputStream output = response.getOutputStream();
    ImageIO.write(image, "PNG", output);
    output.flush();
    out.clear();
    out = pageContext.pushBody();
%>